package light.head.model.el;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 * 培训资料
 */
@Table
@Entity
public class TrainData implements Serializable{
	
	private static final long serialVersionUID = -2031168915295925660L;
	private Integer code;			// 培训资料
	private String name;			// 资料名称
	private String remark;			// 备注
	private String content;			// 资料类容
	private Boolean isPublic;		// 是否公开 
	private String url;				// 视频地址
	private Integer oc;				// 创建机构
	private Integer cu;				// 创建人
	private Date ct;				// 创建时间
	private Boolean deleted = false;		// 是否删除
	
	
	private String cun;				// 创建人姓名
	private List<TrainDataAnnex> list;  // 附件
	private List<CourseDataRelation> cmrList;	//所属课程
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public String getRemark() {
		return remark;
	}
	@Column
	public String getContent() {
		return content;
	}
	@Column
	public Boolean getIsPublic() {
		return isPublic;
	}
	@Column
	public String getUrl() {
		return url;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu)")
	public String getCun() {
		return cun;
	}
	@Transient
	public List<TrainDataAnnex> getList() {
		return list;
	}
	@Transient
	public List<CourseDataRelation> getCmrList() {
		return cmrList;
	}
	
	
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public void setIsPublic(Boolean isPublic) {
		this.isPublic = isPublic;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCun(String cun) {
		this.cun = cun;
	}
	public void setList(List<TrainDataAnnex> list) {
		this.list = list;
	}
	public void setCmrList(List<CourseDataRelation> cmrList) {
		this.cmrList = cmrList;
	}
	
	

}
